use crate::bsl::bsl_types::BSL_Buffer;
use crate::crypto::crypt_algid::{
    CRYPT_KDF_AlgId, CRYPT_KDF_HKDF_AlgId, CRYPT_MAC_AlgId, CRYPT_MD_AlgId, CRYPT_PKEY_ParaId,
};
use crate::crypto::crypt_eal_kdf::CRYPT_EAL_KdfCTX;
use crate::crypto::crypt_types::CRYPT_EAL_LibCtx;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct HITLS_AUTH_PakeCtx {
    _unused: [u8; 0],
}
pub const HITLS_AUTH_PAKE_INVALID: HITLS_AUTH_PAKE_Type = 0;
pub const HITLS_AUTH_PAKE_SPAKE2PLUS: HITLS_AUTH_PAKE_Type = 1;
pub type HITLS_AUTH_PAKE_Type = ::std::os::raw::c_uint;
pub const HITLS_AUTH_PAKE_REQ: HITLS_AUTH_PAKE_Role = 0;
pub const HITLS_AUTH_PAKE_RESP: HITLS_AUTH_PAKE_Role = 1;
pub type HITLS_AUTH_PAKE_Role = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct HITLS_AUTH_PAKE_CipherSuite {
    pub type_: HITLS_AUTH_PAKE_Type,
    pub params: HITLS_AUTH_PAKE_CipherSuite__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union HITLS_AUTH_PAKE_CipherSuite__bindgen_ty_1 {
    pub spake2plus: HITLS_AUTH_PAKE_CipherSuite__bindgen_ty_1__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct HITLS_AUTH_PAKE_CipherSuite__bindgen_ty_1__bindgen_ty_1 {
    pub curve: CRYPT_PKEY_ParaId,
    pub hash: CRYPT_MD_AlgId,
    pub kdf: CRYPT_KDF_HKDF_AlgId,
    pub mac: CRYPT_MAC_AlgId,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct HITLS_AUTH_PAKE_KDF {
    pub algId: CRYPT_KDF_AlgId,
    pub param: HITLS_AUTH_PAKE_KDF__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union HITLS_AUTH_PAKE_KDF__bindgen_ty_1 {
    pub pbkdf2: HITLS_AUTH_PAKE_KDF__bindgen_ty_1__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct HITLS_AUTH_PAKE_KDF__bindgen_ty_1__bindgen_ty_1 {
    pub mac: CRYPT_MAC_AlgId,
    pub iteration: i32,
    pub salt: BSL_Buffer,
}
pub const HITLS_AUTH_PAKE_REQ_REGISTER: HITLS_AUTH_PAKE_CtrlCmd = 4097;
pub const HITLS_AUTH_PAKE_RESP_REGISTER: HITLS_AUTH_PAKE_CtrlCmd = 4098;
pub type HITLS_AUTH_PAKE_CtrlCmd = ::std::os::raw::c_uint;
unsafe extern "C" {
    pub fn HITLS_AUTH_PakeNewCtx(
        libCtx: *mut CRYPT_EAL_LibCtx,
        attrName: *const ::std::os::raw::c_char,
        type_: HITLS_AUTH_PAKE_Type,
        role: HITLS_AUTH_PAKE_Role,
        cipherSuite: HITLS_AUTH_PAKE_CipherSuite,
        password: BSL_Buffer,
        prover: BSL_Buffer,
        verifier: BSL_Buffer,
        context: BSL_Buffer,
    ) -> *mut HITLS_AUTH_PakeCtx;
}
unsafe extern "C" {
    pub fn HITLS_AUTH_PakeFreeCtx(ctx: *mut HITLS_AUTH_PakeCtx);
}
unsafe extern "C" {
    pub fn HITLS_AUTH_Pake_Ctrl(
        ctx: *mut HITLS_AUTH_PakeCtx,
        cmd: HITLS_AUTH_PAKE_CtrlCmd,
        kdfctx: *mut CRYPT_EAL_KdfCTX,
        in0: BSL_Buffer,
        in1: BSL_Buffer,
        in2: BSL_Buffer,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_AUTH_PakeReqSetup(
        ctx: *mut HITLS_AUTH_PakeCtx,
        in_: BSL_Buffer,
        out: *mut BSL_Buffer,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_AUTH_PakeRespSetup(
        ctx: *mut HITLS_AUTH_PakeCtx,
        in0: BSL_Buffer,
        in1: BSL_Buffer,
        out0: *mut BSL_Buffer,
        out1: *mut BSL_Buffer,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_AUTH_PakeReqDerive(
        ctx: *mut HITLS_AUTH_PakeCtx,
        in0: BSL_Buffer,
        in1: BSL_Buffer,
        out0: *mut BSL_Buffer,
        out1: *mut BSL_Buffer,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_AUTH_PakeRespDerive(
        ctx: *mut HITLS_AUTH_PakeCtx,
        in0: BSL_Buffer,
        out0: *mut BSL_Buffer,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_AUTH_PakeGetKdfCtx(
        ctx: *mut HITLS_AUTH_PakeCtx,
        kdf: HITLS_AUTH_PAKE_KDF,
    ) -> *mut CRYPT_EAL_KdfCTX;
}
